var str="A";
var width=15;
var x=" ";
var y="";
var z="";

for(var i=1; i<=(width+1)/2; i++){
  if(i==1){
    y="";
    for(var j1=(width-1)/2; j1>=1; j1--){
      y=y+x;
    }
    y=y+str;
    console.log(y);
  }
  else if (i==(width+1)/2) {
    y="";
    for(var j2=1; j2<=width; j2++){
      y=y+str;
    }
    console.log(y);
  }
  else {
    y="";
    z="";
    for(var j3=(width-2*i+1)/2; j3>=1; j3--){
      y=y+x;
    }
    for(var j4=(2*i-3); j4>=1; j4--){
      z=z+x;
    }
    y=y+str+z+str;
    console.log(y);
  }
}
